<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='老人分配',cssPaths='/static/css/jquery-ui.css,/static/css/services/elderlyallocation/alloction.css',jsPaths='/static/plugins/ueditor/third-party/jquery-1.10.2.min.js,/static/plugins/jquery-ui.min.js,/static/js/services/elderlyallocation/allocation.js')">
<div class="right" th:fragment="right">
    <!--面包屑-->
    <div class="breadcrumb layui-bg-gray">
                    <span class="layui-breadcrumb" lay-separator=">">
                        <a th:href="@{/}">首页</a>
                        <a href="/records">护理管理</a>
                        <a><cite>老人分配</cite></a>
                    </span>
    </div>

    <div class="page-content" th:if="${#lists.size(departments)==0}">
        <h1>您还没有创建护理部门,<a href="/department" style="color:blue">去创建</a></h1>
    </div>

    <!--主体内容区-->
    <div class="page-content" th:if="${#lists.size(departments)>0}">
        <div class="layui-form-item" style="position:relative;width:1150px;">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="sub">立即提交</button>
                <a href="/elderlyAllocation" class="layui-btn layui-btn-warm">&#8194;重&#8195;置&#8194;</a>
            </div>
        </div>
        <form class="layui-form">
            <div class="layui-card" th:each="departments:${departments}">
                <div class="layui-card-header" th:text="${departments.name}"></div>
                <div style="border:1px dashed  #000;min-height: 150px;width:45%;" class="departments elder-box">
                    <input type="hidden" value="departmentId" class="departmentId" th:value="${departments.id}">
                    <div th:each="elderlyList:${departments.elderlyList}" class="elderly">
                        <input type="hidden" name="elderlyId" th:value="${elderlyList.id}">
                        <div th:text="${elderlyList.buildingNo}+'-'+${elderlyList.roomNo}+'-'+${elderlyList.bedNo}"
                             style="font-size: 12px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 100px;"></div>
                        <img th:if="${elderlyList.avatar==null || elderlyList.avatar==''}" class="imgSize"
                             src='/static/imgs/elder.png'>
                        <img th:if="${elderlyList.avatar!=null &&  elderlyList.avatar!=''}" class="imgSize"
                             th:src="@{'/storage/files/'+${elderlyList.avatar}}">
                        <div th:text="${elderlyList.name}"></div>
                    </div>
                </div>
            </div>
            <div id="div">
                <div class="layui-card">
                    <div class="layui-card-header">未分配老人</div>
                    <table class="layui-table" lay-skin="nob">
                        <tr>
                            <td>
                                <a href="/elderlyAllocation?healthCondition=0"
                                   class="layui-btn layui-btn-primary">全部</a>
                                <a href="/elderlyAllocation?healthCondition=1" class="layui-btn layui-btn-primary">具备自理能力</a>
                                <a href="/elderlyAllocation?healthCondition=2" class="layui-btn layui-btn-primary">部分丧失自理能力</a>
                                <a href="/elderlyAllocation?healthCondition=3" class="layui-btn layui-btn-primary">完全丧失自理能力</a>
                            </td>
                        </tr>
                    </table>
                    <div style="height:450px;overflow-y:auto;" class="elder-box departments">
                        <div class="elderly" th:each="noCheckedInElderly:${noCheckedInElderly}">
                            <input type="hidden" name="elderlyId" th:value="${noCheckedInElderly.id}">
                            <div th:text="${noCheckedInElderly.buildingNo}+'-'+${noCheckedInElderly.roomNo}+'-'+${noCheckedInElderly.bedNo}"
                                 style="font-size: 12px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 100px;"></div>
                            <img th:if="${noCheckedInElderly.avatar==null || noCheckedInElderly.avatar==''}"
                                 class="imgSize" src='/static/imgs/elder.png'>
                            <img th:if="${noCheckedInElderly.avatar!=null &&  noCheckedInElderly.avatar!=''}"
                                 class="imgSize" th:src="@{'/storage/files/'+${noCheckedInElderly.avatar}}">
                            <div th:text="${noCheckedInElderly.name}"></div>
                        </div>
                    </div>
                </div>
            </div>

        </form>
    </div>
</div>
</html>